home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Docs / FileFormat.txt < prev    next >
Encoding:
Text File  |  1997-06-17  |  7.0 KB  |  338 lines

  1. /*
  2. **   Description of the file format of IEditor's data files
  3. **
  4. **   This is © Copyright 1994-95 Simone Tellini
  5. **
  6. **   This file can NOT be distributed in any way, without my
  7. **   EXPLICIT permission.
  8. **
  9. */
  10.  
  11.  
  12. STR identifies a String: in IE's files, string are stored in this way:
  13.  
  14. UBYTE  String Length
  15. CHAR   String (_without_ the final 0)
  16. CHAR   PadToWord  (ONLY present if StringLen+1 is odd)
  17.  
  18. So, an empty string looks like:
  19.  
  20. $00 $00
  21.      ^^
  22.  ^^   `---> Pad ( strlen + 1 = 0 + 1 = 1, ODD )
  23.   `-------> String length = NULL
  24.  
  25.  
  26.  
  27. This is the file format:
  28. ========================
  29.  
  30. *** File header
  31.  
  32. LONG   Header       ; 'IEDf'
  33. LONG   Version      ; currently 3, be SURE to check it *before* loading
  34.                     ; the rest of the file
  35. LONG   InterfaceID  ; 'INTF'
  36.  
  37. BYTE   SrcFlags     ; currently only bit 6 is defined: if set, the code
  38.                     ; should be font adaptive.
  39.  
  40. BYTE   GenerateScr  ; if <> 0 you should generate the code for the
  41.                     ; Screen too.
  42.  
  43. *** Screen data
  44.  
  45. WORD   Width
  46. WORD   Height
  47. WORD   Depth
  48. LONG   DisplayID
  49. WORD   Overscan     ; value to pass to SA_Overscan
  50. WORD   AutoScroll   ;   "   "   "   "  SA_Autoscroll
  51. WORD   Font YSize
  52. BYTE   Font Flags
  53. BYTE   Font Style
  54. WORD   ScrAttrs     ; described below
  55. WORD   Left
  56. WORD   Top
  57. WORD   ScreenType   ; CUSTOM or PUBLIC
  58. WORDS  DriPens      ; There are 12 words
  59. STR    FontName
  60. STR    Title
  61. STR    PubName
  62.  
  63. ; Here comes the Palette: colors are stored in RGB format, 8 bit per gun.
  64. ; Their number depends on Depth, of course.
  65.  
  66. *** Window Data
  67.  
  68. WORD   Windows Number   ; it could be equal to 0, e.g. if the file
  69.                         ; contains only ARexx commands.
  70.  
  71. ; Then, for each window
  72.  
  73. WORD   TopEdge
  74. WORD   LeftEdge
  75. WORD   Width
  76. WORD   Height
  77. WORD   MinWidth
  78. WORD   MaxWidth
  79. WORD   MinHeight
  80. WORD   MaxHeight
  81. WORD   InnerWidth
  82. WORD   InnerHeight
  83. WORD   ZoomLeft     ; array to pass to WA_Zoom
  84. WORD   ZoomTop
  85. WORD   ZoomWidth
  86. WORD   ZoomHeight
  87. WORD   MouseQueue
  88. WORD   RptQueue
  89. LONG   Window Flags
  90. LONG   IDCMP
  91. LONG   WndTags      ; Packet of tags, see below
  92. STR    Title
  93. STR    ScreenTitle
  94. STR    Label        ; if not present, you MUST provide a valid label.
  95.  
  96. WORD   Number of Gadgets
  97. [...Gadgets Data...]
  98. WORD   Number of Menus
  99. [...Menus Data...]
  100. WORD   Number of Boolean Gadgets
  101. [...Booleans Data...]
  102. WORD   Number of Bevel Boxes
  103. [...]
  104. WORD   Number of Images
  105. [...]
  106. WORD   ControlWord      ; if = 0 then there aren't other informations
  107.                         ; about this window else...
  108. WORD   Number of IntuiTexts
  109. [...]
  110. WORD   ControlWord      ; this is here just for upward compatibilty ;)
  111.  
  112. WORD   Number of Image structure (not the Images drawn on windows)
  113. [...]
  114. WORD   ThereIsARexx?    ; if <>0, read...
  115. [...]                   ; ...ARexx Data
  116.  
  117. Well, let's try to explain what you've just read:
  118.  
  119. These is the structure:  (less or more... ;-)
  120.  
  121.    |
  122.    +-> Number of Windows
  123.    |
  124.  > +----> Window Data
  125.  | | |
  126.  | | +--> Number of Gadgets in this window
  127.  | | | |
  128.  | | | `-> Gadgets Data
  129.  | | |
  130.  | | +--> Number of Menus
  131.  | | | |
  132.  | | | `-> Menus data
  133.  | ....
  134.  | ....
  135.  | |
  136.  `-'
  137.    |
  138.    |
  139.  
  140. Anyway, you have understood, don't you? ;-)
  141.  
  142.  
  143.  
  144. *** Gadgets Data
  145.  
  146. WORD    LeftEdge
  147. WORD    TopEdge
  148. WORD    Width
  149. WORD    Height
  150. LONG    Flags
  151. WORD    Kind
  152. LONG    GadgetTags      ; as for WndTags, these are bit-mapped
  153. LONG    Data1           ; the content of these fields depends on
  154. LONG    Data2           ; the gadget kind, see the related file.
  155. ...
  156. LONG    Data7
  157. WORD    Font YSize
  158. BYTE    Font Flags
  159. BYTE    Font Style
  160. WORD    Number of Items ; for MXs, CYCLEs and LISTVIEWs
  161. STRS    Item            ; if Number of Items is = 0 these strings aren't
  162.                         ; present, of course.
  163. STR     String          ; ONLY for STRING and TEXT gadgets
  164. STR     GadgetText
  165. STR     Label
  166. STR     FontName
  167.  
  168.  
  169. ***  Menus Data
  170.  
  171. BYTE    MenuFlags       ; bit-mapped
  172. BYTE    Pad
  173. WORD    Number of Items
  174. STR     Text
  175. STR     Label
  176.  
  177. ; then, if there are items...
  178.  
  179. BYTE    MenuFlags       ; bit-mapped
  180. BYTE    Pad
  181. STR     Text
  182. STR     CommKey
  183. STR     Label
  184. WORD    Image           ; this is the *number* of the image to use
  185.                         ; -1 means NO IMAGE
  186.                         ; if the image is set, this will be a IM_ITEM
  187. LONG    MutualExclude
  188. WORD    Number of SubItems
  189.  
  190. ; ...if there are SubItems...
  191.  
  192. BYTE    MenuFlags
  193. BYTE    Pad
  194. STR     Text
  195. STR     CommKey
  196. STR     Label
  197. WORD    Image
  198. LONG    MutualExclude
  199.  
  200.  
  201. ***  Boolen Gadgets Data
  202.  
  203. WORD    Left                ; Gadget structure (gg_...)
  204. WORD    Top
  205. WORD    Width
  206. WORD    Height
  207. WORD    Flags
  208. WORD    Activation
  209. WORD    GadgetType          ; always = GTYP_BOOLGADGET
  210. WORD    RenderImage         ; number of the image
  211. WORD    SelectRenderImage
  212. BYTE    FrontPen            ; IntuiText structure
  213. BYTE    BackPen
  214. BYTE    DrawMode
  215. BYTE    Pad
  216. WORD    TextLeft
  217. WORD    TextTop
  218. WORD    Font YSize
  219. BYTE    Font Flags
  220. BYTE    Font Style
  221. BYTE    UseText         ; if = 0, this gadget does *NOT* have a text
  222. BYTE    TitleLength     ; this is a STR, but it considers the UseText
  223. CHARS   Title           ; byte when aligning to a word boundary.
  224. BYTE    Pad             ; present if TitleLength is ODD
  225. STR     Label
  226. STR     null            ; for backward compatibility
  227. STR     null
  228.  
  229.  
  230. ***  Bevel Boxes Data
  231.  
  232. WORD    Left
  233. WORD    Top
  234. WORD    Width
  235. WORD    Height
  236. LONG    Recessed        ; 0 if not
  237. LONG    FrameType
  238.  
  239.  
  240. ***  Images Data
  241.  
  242. WORD    Left
  243. WORD    Top
  244. WORD    Image Number        ; number of the image to use
  245.  
  246.  
  247. ***  IntuiTexts Data
  248.  
  249. BYTE    FrontPen
  250. BYTE    BackPen
  251. BYTE    DrawMode
  252. BYTE    TextFlags       ; currently only bit 0 is defined: if set,
  253.                         ; this IntuiText uses the ScreenFont
  254. WORD    Left
  255. WORD    Top
  256. STR     Text
  257. WORD    ControlWord     ; if 0, there aren't other data for this text
  258. STR     FontName
  259. WORD    Font YSize
  260. BYTE    Font Flags
  261. BYTE    Font Style
  262.  
  263.  
  264. ***  Image Structures Data
  265.  
  266. WORD    Width
  267. WORD    Height
  268. WORD    Depth
  269. LONG    Size of Data
  270. BYTES   Data
  271. BYTE    PlanePick
  272. BYTE    PlaneOnOff
  273. STR     Label
  274.  
  275.  
  276. ***  ARexx Data
  277.  
  278. STR     PortName
  279. STR     Extension
  280. WORD    Number of Commands
  281.  
  282. ***  ARexx Command
  283.  
  284. STR     Label
  285. STR     Name
  286. STR     Template
  287.  
  288.  
  289.  
  290. ***  Bits
  291.  
  292.  ,---------> Bit Number
  293. |       ,--> Its meaning (when set)
  294. V       V
  295.  
  296. Bit scheme of ScrAttrs:
  297. -----------------------
  298.  
  299. 0   -   Use WA_Left
  300. 1   -   Use WA_Top
  301. 2   -   SA_ShowTitle   =   TRUE
  302. 3   -   SA_Behind      =   TRUE
  303. 4   -   SA_Quiet       =   TRUE
  304. 5   -   Use SA_Overscan
  305. 6   -   SA_FullPalette =   TRUE
  306. 7   -   SA_ErrorCode   =   TRUE
  307. 8   -   SA_Draggable   =   TRUE
  308. 9   -   SA_Exclusive   =   TRUE
  309. 10  -   SA_SharePens   =   TRUE
  310. 11  -   SA_Interleaved =   TRUE
  311. 12  -   SA_LikeWorkbench = TRUE
  312. 13  -   SA_MinimizeISG =   TRUE
  313.  
  314.  
  315.  
  316. Bit scheme of WndTags:
  317. ----------------------
  318.  
  319. 1   -   Use WA_ScreenTitle
  320. 2   -   Set WA_MouseQueue
  321. 3   -   Set WA_RptQueue
  322. 4   -   WA_AutoAdjust       =   TRUE
  323. 5   -   WA_FallBack         =   TRUE
  324. 6   -   Use WA_Zoom
  325. 7   -   WA_TabletMessage    =   TRUE
  326. 8   -   WA_MenuHelp         =   TRUE
  327. 9   -   WA_NotifyDepth      =   TRUE
  328.  
  329.  
  330. Bit scheme of MenuFlags:
  331. ------------------------
  332.  
  333. 0   -   Disabled
  334. 1   -   BarLabel
  335. 2   -   CheckIt
  336. 3   -   Checked
  337. 4   -   MenuToggle
  338.